<h1> Import your post via rss feed </h1>
Insert RSS link:
<input type="text" value="" size="50" maxlength="1000" id="my_rss" />
<button class="click">Import</button>

<br/><br/><br/><span style='color:red'></span><br/>
<table id="data_table" border="1">
<tr>
<th>Serial</th>
<th>Title</th>
<th>Import possible</th>
<th>Import link</th>
</tr>
</table> 

<script type="text/javascript">
(function($){
$(".click").click(function(){
	var url=$("#my_rss").val();
	//var url="http://api.flickr.com/services/feeds/groups_pool.gne?id=741815@N22&lang=en-us";

	$.getJSON("https://ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=20&callback=?&q="+encodeURI(url),
function(data)
{
	importedData= data.responseData.feed.entries;
	for(var i=0; i<data.responseData.feed.entries.length;++i)
	{
		//alert( data.responseData.feed.entries[i].title);
		//console.log(data.responseData.feed.entries[i]);
		if( data.responseData.feed.entries[i].content == '')
			continue;
		$("#data_table tbody").append(
		"<tr><td>"+(i+1)+"</td><td>"+data.responseData.feed.entries[i].title+"</td><td>yes</td><td>"+
		'<button onclick="insertPost('+i+')" style="font-style:bold" >Submit</button>'
		+"</td></tr>"
		);
	}
	});

	insertPost= function(i)
	{
		var data={
			title: importedData[i].title,
			content: importedData[i].content,
			link: importedData[i].link
		};
		$.post("<?PHP echo get_bloginfo("template_url"); ?>/customPhpScript/insert_new_posts.php",data,function(response)
		{
			alert(response);
			/*
			if( response == "1, success")
			{
				$($("#data_table tr").get(i+1)).remove();
			}
			*/
		});
	}
});

//end of function
})(jQuery);
</script>

<br/><br/><br/><br/>
